package com.hushao.lims.weblims.service;

import com.hushao.lims.weblims.domain.ConsumableStorage;
import com.hushao.lims.weblims.domain.TeacherInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author 930588706
 * @date 18/1/22
 * 耗材入库表
 */
public interface ConsumableStorageService {
    /**
     * 耗材入库
     * @param consumableStorage
     * @return
     * @throws Exception
     */
    ConsumableStorage saveConsumableStorage(ConsumableStorage consumableStorage) throws Exception;

    /**
     *  根据耗材名称模糊查询个人耗材入库
     * @param consumberName
     * @param teacherInfo
     * @param pageable
     * @return
     * @throws Exception
     */
    Page<ConsumableStorage> listConsumableStorageByTeacherAndConsumableName(String consumberName, TeacherInfo teacherInfo, Pageable pageable) throws Exception;

    /**
     * 删除待审核的耗材入库
     * @param consumableStorageId
     * @throws Exception
     */
    void remove(Long consumableStorageId) throws Exception;

    /**
     * 根据耗材名称，状态模糊查询耗材入库
     * @param consumableName
     * @param state
     * @param pageable
     * @return
     */
    Page<ConsumableStorage> listConsumableStorageByConsumableNameLikeAndStateLike(String consumableName, String state, Pageable pageable);

    /**
     * 审核耗材入库
     * @param consumableStorageId
     * @param state
     * @param teacher
     * @return
     * @throws Exception
     */
    ConsumableStorage audit(Long consumableStorageId, String state, TeacherInfo teacher) throws Exception;

    /**
     * 完成耗材入库
     * @param consumableStorageId
     * @return
     * @throws Exception
     */
    ConsumableStorage achieve(Long consumableStorageId)throws Exception;
}
